package com.icim.dao;

import com.icim.entity.Bis_layot;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

@Repository
public class BisLayOtDao {
    @Resource
    private JdbcTemplate icimJdbcTemplate;

    public List<Bis_layot> getLayotInfos(String layot_id) {
        String sql="SELECT LAYOT_CATE FROM BIS_LAYOT WHERE LAYOT_ID = ?";
        return icimJdbcTemplate.query(sql, new String[]{layot_id}, new RowMapper<Bis_layot>(){

            @Override
            public Bis_layot mapRow(ResultSet rs, int rowNum) throws SQLException {
                Bis_layot bisLayot=new Bis_layot();
                bisLayot.setLayot_cate(rs.getString("LAYOT_CATE"));
                return bisLayot;
            }

        });

    }
}
